package com.shanzmoo.admin.manager.store;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.shanzmoo.db.store.entity.query.StoreReceiveBillDetailQuery;
import com.shanzmoo.db.store.entity.vo.StoreReceiveBillDetailVO;
import com.shanzmoo.base.bean.PageRespBase;
import com.shanzmoo.db.store.service.IStoreReceiveBillDetailService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;


/**
 * 仓库收货单明细 管理器
 *
 * @author Gzhao 2021-03-11
 */
@Slf4j
@Component
public class StoreReceiveBillDetailManager {

    @Autowired
    private IStoreReceiveBillDetailService storeReceiveBillDetailService;

    /**
     * 分页查询
     */
    public PageRespBase<StoreReceiveBillDetailVO> queryPage(StoreReceiveBillDetailQuery query) {
        Page page = PageHelper.startPage(query.getPageNum(), query.getPageSize());
        List<StoreReceiveBillDetailVO> reList = storeReceiveBillDetailService.queryPageList(query);

        PageRespBase<StoreReceiveBillDetailVO> result = PageRespBase.create(page, reList);
        PageHelper.clearPage();
        return result;
    }
 }
